package com.tender.controller;

import com.tender.common.ActionResult;
import com.tender.dtos.CoscoShipDetailDTO;
import com.tender.dtos.CoscoShipHistoryTracesDTO;
import com.tender.dtos.CoscoShipLatestAisInfoDTO;
import com.tender.dtos.CoscoShipLatestBerthHistoryDTO;
import com.tender.model.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/visualization/cosco/ship")
@Tag(name = "中远海科-船舶-控制器类", description = "中远海科-船舶-控制器类")
public class CoscoShippingController {

    @Operation(summary = "中远海科-船舶基本信息")
    @PostMapping("/detail")
    public ActionResult<CoscoShipDetailDTO> queryShipBasicInfo(@RequestBody RpcCoscoShipDetailCondition param) {
        return ActionResult.success();
    }

    @Operation(summary = "中远海科-实时AIS信息")
    @PostMapping("/latest/ais")
    public ActionResult<CoscoShipLatestAisInfoDTO> queryShipLatestAis(@RequestBody RpcCoscoShipLatestAisInfoCondition param) {
        return ActionResult.success();
    }

    @Operation(summary = "中远海科-历史轨迹信息")
    @PostMapping("/history/trace")
    public ActionResult<CoscoShipHistoryTracesDTO> queryShipHistoryTrace(@RequestBody RpcRpcCoscoCustomShipHistoryTracesCondition param) {
        return ActionResult.success();
    }

    /*
        -- 找船 sql
        select ship_visit_id , rtb, dta, eta from ship_visit@ZX_HQ where ship_code = 'NXL' order by rtb desc, dta desc, eta desc;
        select * from ship_visit@ZX_HQ where ship_visit_id = '62509';
        select * from ship_manifest@zx_hq where ship_visit_id = '62509';
     */
    @Operation(summary = "中远海科-上一个港口-实际离港时间和靠泊记录")
    @PostMapping("/lastPort/berthHistory")
    public ActionResult<CoscoShipLatestBerthHistoryDTO> getLatestRtdAndBerthHistory(@RequestBody CoscoShipLatestBerthHistoryCondition param) {
        return ActionResult.success();
    }


    /**
     * rtb 实际靠泊时间
     */
    @Operation(summary = "中远海科-获取下一个港口的实际到港时间和未来的靠泊记录")
    @PostMapping("/nextPort/berthHistory")
    public ActionResult<CoscoShipFutureBerthHistoryCondition> getNextRtbAndFutureBerthHistory(@RequestBody CoscoShipFutureBerthHistoryCondition param) {
        return ActionResult.success();
    }

}
